﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WiTeach.CourseManagement.View;
using System.Diagnostics;

namespace WiTeach.ClassManagement.View
{
    /// <summary>
    /// ProgramWriting.xaml 的交互逻辑
    /// </summary>
    public partial class ProgramWriting : Page
    {
        public int lessonID;
        public int classHourID;
        public ProgramWriting(int lessonID, int classHourID)
        {
            InitializeComponent();
            // 修改页面背景主题
            ImageBrush brush = new ImageBrush();
            brush.Stretch = Stretch.Fill;
            brush.ImageSource = new BitmapImage(new Uri(App.backgroundImage, UriKind.RelativeOrAbsolute));
            this.Background = brush;
            this.lessonID = lessonID;
            this.classHourID = classHourID;
        }

        private void backHome(object sender, RoutedEventArgs e)
        {
            CourseIndex courseIndex = new CourseIndex();
            this.NavigationService.Navigate(courseIndex);
        }

        private void backPreLevel(object sender, RoutedEventArgs e)
        {
            this.NavigationService.GoBack();
        }

    

        private void ProgramRecording(object sender, RoutedEventArgs e)
        {
            ProgramRecording programRecording = new ProgramRecording(lessonID, classHourID);
            this.NavigationService.Navigate(programRecording);
        }

        private void TeachingDemonstration(object sender, RoutedEventArgs e)
        {
            TeachingDemonstration teachingPage = new TeachingDemonstration(lessonID, classHourID);
            this.NavigationService.Navigate(teachingPage);
        }

        private void sa_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string S4A15_path = System.Configuration.ConfigurationManager.AppSettings["app_S4A15"];
            //    System.Diagnostics.Process.Start(@S4A15_path);
                Process sa = new Process();
                sa.StartInfo.FileName = S4A15_path;
                sa.Start();
                sa.WaitForExit();
                sa.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

        }

        private void uv4_Click(object sender, RoutedEventArgs e)
        {
            string KEIL_Lic_path = System.Configuration.ConfigurationManager.AppSettings["app_KEIL_Lic"];
      //      System.Diagnostics.Process.Start(@KEIL_Lic_path);
            try
            {
                Process uv4 = new Process();
                uv4.StartInfo.FileName = KEIL_Lic_path;
                uv4.Start();
                uv4.WaitForExit();
                uv4.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
           
        }

        private void program_writing_backmain_mouse_enter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 66;
            image.Width = 104;
        }
        private void program_writing_backmain_mouse_leave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 60;
            image.Width = 98;
        }
        private void program_writing_back_mouse_enter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 66;
            image.Width = 104;
        }
        private void program_writing_back_mouse_leave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 60;
            image.Width = 98;
        }

        private void program_writing_choice_mouse_enter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 250;
            image.Width = 256;
        }
        private void program_writing_choice_mouse_leave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 248;
            image.Width = 254;
        }
        private void program_writing_program_enter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 100;
            image.Width = 96;
        }
        private void program_writing_program_leave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 94;
            image.Width = 90;
        }

        private void program_writing_demonstrate_enter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 85;
            image.Width = 96;
        }
        private void program_writing_demonstrate_leave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 80;
            image.Width = 90;
        }
    }
}
